/*
* LongestRunsOfOnes.h
* Last edited: 21.07.2014
* Author: David Noack
*/

#pragma once
#include "NistTest.h"
#include <boost\math\special_functions\gamma.hpp>


struct v_class{
	short value;
	short count;
	double pi;
};


/**
\class LongestRunOfOnes
\brief Implementation of the Nist Longest Run of Ones Test
*/
class LongestRunOfOnes : public NistTest
{
	public:
		/** Construktor
		\param bitArray Represents the random bits which have to be tesed.
		\param bitArraySize The size of bitArry in bits.*/
		LongestRunOfOnes(bool* bitArray, int bitArraySize);
		/**Destructor*/
		~LongestRunOfOnes(){};

		/**Does nothing here*/
		void start(){};

		/**Executes the LongestRunOfOnes-test at the bitArray, given by the constructor.
		\param size The number of bits you want to test within the bitArray.*/
		double execute(int size);

	private:
		/** Size of one Block*/
		int blockSize;
		/**The number of blocks within bitArry of Size blockSize*/
		int numberOfblocks;
		/**Chi-Square Distribution*/
		double chi_sqr;
		/**Pointer to a Array of type v_class*/
		v_class* v;

};

